package parts4.lesson44;

//课时44 Runtime类
public class Demo {
    public static void main(String[] args) {
        Runtime run = Runtime.getRuntime();
        long size = run.freeMemory();
        size = byteToM(size);
        System.out.println(size);

        long size2 = run.totalMemory();
        size2 = byteToM(size2);
        System.out.println(size2);

        long size3 = run.maxMemory();
        size3 = byteToM(size3);
        System.out.println(size3);
    }

    public static long byteToM(long num) {
        return (long) num / 1024 / 1024;
    }
}
